
import React, { Component } from 'react';

export default (Comp,fn) => {
	class CallComponentMethods extends Component {
		componentDidMount(){
			fn&&fn(this.comp);
		}
		render(){
			return <Comp {...this.props} ref={comp=>this.comp=comp} />
		}
	}
	return CallComponentMethods;
}